package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;

/**
 * @author Renato Miceli
 */
public class UserInfoPanel extends GenericInfoPanel<UserInfo> {

	public UserInfoPanel() {
		// Do nothing!
	}

	public UserInfoPanel(UserInfo info) {
		updateInfo(info);
	}

	public void updateInfo(UserInfo currentInfo) {
		this.setHtml("<br><b>Login: " + currentInfo.getLogin() + "<br>Name: " + currentInfo.getName() + "<br>Email: " + currentInfo.getEmail()
				+ "<br>Type: " + ((currentInfo.getLevel() == UserInfo.UserPermission.ADMIN) ? "Administrator" : "Basic User") + "<br>Authorized: "
				+ (currentInfo.isAuthorized() ? "yes" : "no") + "</b><br>");
	}

}
